Skip to content

Conversation

@WaterWhisperer
Copy link
Contributor

@WaterWhisperer WaterWhisperer commented Dec 18, 2025

Fixes #11034

changelog: [main_recursion]: none

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 18, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 18, 2025

r? @samueltardieu

rustbot has assigned @samueltardieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@samueltardieu
Copy link
Member

Isn't the lint expected to ignore no_std entry points? The lint description contains:

Why is this bad?

Apart from special setups (which we could detect following attributes like #![no_std]),
recursing into main() seems like an unintuitive anti-pattern we should be able to detect.

@WaterWhisperer WaterWhisperer force-pushed the main-recursion-tests-11034 branch from fd7f79f to 9bfc9a4 Compare December 19, 2025 14:38
@WaterWhisperer
Copy link
Contributor Author

Isn't the lint expected to ignore no_std entry points? The lint description contains:

Why is this bad?

Apart from special setups (which we could detect following attributes like #![no_std]),
recursing into main() seems like an unintuitive anti-pattern we should be able to detect.

Thanks for the review! You are absolutely right. I misread the documentation. I have reverted the change that enabled the lint for no_std crates.

Copy link
Member

@samueltardieu samueltardieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please shorten the PR description to its core, and this will be ready to merge.

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jan 18, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@WaterWhisperer
Copy link
Contributor Author

Can you please shorten the PR description to its core, and this will be ready to merge.

View changes since this review

Okay

@WaterWhisperer
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Jan 18, 2026
@samueltardieu samueltardieu changed the title fix: main_recursion enable lint in no_std crates and fix broken tests fix main_recursion tests Jan 18, 2026
@samueltardieu samueltardieu changed the title fix main_recursion tests Fix main_recursion tests Jan 18, 2026
@samueltardieu
Copy link
Member

Thanks.

@samueltardieu samueltardieu added this pull request to the merge queue Jan 18, 2026
Merged via the queue into rust-lang:master with commit a5ae164 Jan 18, 2026
19 of 20 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 18, 2026
@WaterWhisperer WaterWhisperer deleted the main-recursion-tests-11034 branch January 18, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clippy::main_recursion tests seem to be testing nothing anymore

3 participants